CALLBACKS
eventFrame()
is called on every frame

eventGameStart()
is called when the game starts/reinitialises (currently may be called twice on start)

eventInternalAddAnim(ped, animType)
is called when the game starts an animation of animType on the ped

eventInternalBlendAnim(ped, animType)
is called when the game starts an animation of animType on the ped (with blending)

eventBulletFired(shooter, weaponId, endPosition, target, fragmentNumber, fragmentTotal)
is called when a bullet is fired, target is None if missed or the entity that got shot, fragment numbers are for shotgun rounds







MODULE mbase

logPrint(message)
writes to MVL's log file

registerCallback(eventName, callbackFunction)
callbackFunction will be called on event specified by eventName

getFrameCount()
returns current frame count

checkKeysPressed(keyList)
replaces the keycodes in the list with 1s and 0s which specify whether that key was down or not, returns the changed list

setHudMessage(messageType, message)
shows hud message, currently only messageType supported is 0






MODULE ment

getEntModelIndex(entity)
returns the model index of the entity

getEntPosition(entity)
returns the position of the entity as a tuple

setEntPosition(entity, position)
sets the position of an entity (for example: ment.setEntPosition(mped.getPlayerPed, (0,0,0))  )

getEntSpeed(entity)
returns the speed of an entity

setEntSpeed(entity, speed)
sets the speed of an entity

getEntType(entity)
returns the type of an entity ("building", "ped", "vehicle", "object")

findEntitiesInRange(entityType, centerPosition, radius)
returns a list of all entities of the specified type in the range from center position

getAllEntities(entityType)
returns a list of all entities of the specified type






MODULE mped

getPlayerPed()
returns handle to the player

getPedVehicle(ped)
returns handle to the vehicle the specified ped is in

getPedHealth(ped)
returns ped health

setPedHealth(ped, health)
sets ped health to given value

getPedArmour(ped)
return ped armour

setPedArmour(ped, armour)
sets ped armour to given value

givePedWeapon(ped, weapon, ammo, if_adds, if_switches)
gives player the specified weapon, if "if_adds" is True, then adds to existing ammo, if "if_switches" is True, then switches to that weapon

getPedCurrentWeapon(ped)
returns current weapon ID of the ped

getPedCurrentTotalAmmo(ped)
returns current total ammo

getPedCurrentLoadedAmmo(ped)
returns current loaded ammo

getCurrentWeaponSlot(ped)
returns ped's selected weapon slot

setCurrentWeaponSlot(ped)
sets ped's selected weapon slot






MODULE mveh

createVehicle(modelIndex, (x, y, z), (x_rot, y_rot, z_rot), isPermanent)
creates a new vehicle (isPermanent is 0 or 1) and returns its handle

getTuningPartCount(modelIndex)
returns the number of different tunable parts of the specified model index

getTuningPartName(modelIndex, partIndex)
returns the name of one tunable part

getTuningPartVarCount(modelIndex, partIndex)
returns the number of versions of one tunable part

getVehUsedTuningPart(vehicle, partIndex)
returns the currently active version index of a tunable part

setVehUsedTuningPart(vehicle, partIndex, versionIndex)
sets the currently active version index of a tunable part

getVehModelAIType(modelIndex)
returns the AI type of the specified model index ("police", "swat", "predator", "tank", "barracks", "fbi", "vice", "firetruck", "ambulance", "taxi")

setCarTaxiLightState(vehicle, taxiLightState)
sets the current state (True, False) of a car's taxi light

getVehicleHealth(vehicle)
returns vehicle's health

setVehicleHealth(vehicle, health)
sets vehicle's health

blowVehicleUp(vehicle)
blows up a vehicle






MODULE mworld

getWeather()
returns the index of current weather

getTime()
returns the current time as a tuple (hours, minutes)

rayTrace(startPos, endPos, ignoreEntity, typesToCheck)
returns a tuple (if_collided, collision_entity, collision_pos), typesToCheck can contain characters "b" - building, "v" - vehicle, "p" - peds, "o" - objects, "d" - dummies, "t" - transparents, "P" - peds on boats/bikes, "D" - dead peds, "w" - vehicle wheels

startFireOnEntity(entity, sourceEntity)
starts fire on an entity, sourceEntity is the entity that caused it (can be None)

createExplosion(source, type, (x, y, z))
creates an explosion, source is the ped/vehicle "responsible" for the explosion (if it's player, it will cause wanted stars)






MODULE manim

loadAnimationFile(animFilePath)
returns a list of animation types that were contained in that file, or None if loading failed; if already loaded, increase reference count

unloadAnimationFile(animFilePath)
decreases reference count of anim file path, if zero, unload its animations and remove those from any peds that are using them; use with caution

initAnimType(animationType, animIndex, animGroupIndex, animFlags)
initializes an animation type loaded from a file - do this before using

getStockAnimation(animGroupIndexOrName, animIndexOrName)
returns an animation type for a stock animation, None if not found

addPedAnimation(ped, animationType)
returns an animation if successful

blendPedAnimation(ped, animationType, blendSpeed)
returns an animation if successful

getAllPedAnimations(ped)
returns a list of animations, None if invalid params

findPedAnimation(ped, animIndex)
returns the first animation that has the specified index, otherwise returns None

getAnimPed(animation)
returns the ped that the animation is attached to

getAnimIndex(animation / animationType)
returns the animation index of an animation

getAnimGroupIndex(animation / animationType)
returns the animation group index of an animation

getAnimName(animation / animationType)
returns the name of an animation

getAnimFlags(animation / animationType)
returns the flags of an animation

getAnimLength(animation / animationType)
returns animation length

getAnimProgress(animation)
returns animation progress, from 0 to animation length

getAnimSpeed(animation)
returns animation speed

getAnimBlendProgress(animation)
returns animation blend progress (float)

getAnimBlendSpeed(animation)
returns animation blend speed (float)

getAnimCallback(animation)
returns tuple (callbackType, callbackFunc, callbackArgument), if the callback is set from python, callbackFunc and callbackArgument are python objects, otherwise they are integers, returns None if no callback set

setAnimCallback(animation, callbackType, callbackFunc, callbackArgument)
returns True or False

setAnimFlags(animation, flags)
sets animation flags

setAnimProgress(animation, progress)
sets animation progress, returns None

setAnimSpeed(animation, speed)
sets animation speed, returns None

setAnimBlendProgress(animation, blendProgress)
sets animation blend progress, returns None

setAnimBlendSpeed(animation, blendSpeed)
sets animation blend speed, returns None

removeAnim(animation)
immediately removes an animation, returns None

invokeAnimCallback(animation, callbackTuple)
runs an animation callback - if you want to set your old callback and make the old one still run, you can call this with the value you received from getAnimCallback before you set your callback






MODULE mrw

getEntityObject(entity)
returns either the entity's clump or atomic, based on whether it's a building or ped/object/vehicle respectively

getAtomicFrame(atomic)
returns atomic's frame

getClumpFrame(clump)
returns clump's frame

getFrameName(frame)
returns the name of a frame

getFrameRelativeMatrix(frame)
returns frame's matrix relative to parent

getFrameAbsoluteMatrix(frame)
returns frame's matrix in the world

getFrameFirstChild(frame)
returns the first child frame of a frame, or None if there are no children







MODULE mscm

registerHandler(opcode, handler, parameterFormat)
the handler function you specify will be called when that opcode is used in SCM

scriptWait()
if called within a handler, the script will be paused until the next frame after that opcode